package com.wang.system.service.system.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wang.entity.model.SysUserModel;
import com.wang.entity.system.SysUser;
import com.wang.entity.vo.SysUserVo;
import com.wang.system.mapper.SysUserMapper;
import com.wang.system.service.system.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author wang
 * @Date 2024/9/22 1:29
 * @PackageName:com.wang.system.service.system.impl
 * @ClassName: SysUserServiceImpl
 * @Description: TODO
 * @Version 1.0
 */
@Service
@Transactional
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    @Autowired
    private SysUserMapper userMapper;

    @Override
    public SysUserVo findByUsername(String username) {
        return userMapper.findByUsername(username);
    }

    @Override
    public int existsByUsername(String username) {
        return userMapper.existsByUsername(username);
    }

    @Override
    public IPage<SysUserVo> queryPageList(SysUserModel sysUser, Page<SysUserVo> page) {
        return userMapper.pageDataList(sysUser,page);
    }

    @Override
    public IPage<SysUserVo> queryRecycleList(SysUserModel sysUser, Page<SysUserVo> page) {
        return userMapper.pageRecycleList(sysUser,page);
    }

    @Override
    public SysUser getRecycleById(Long userId) {
        return userMapper.getRecycleById(userId);
    }

    @Override
    public void updateRecycleById(SysUser user) {
        userMapper.updateRecycleById(user);
    }


}
